Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Push down slice with non-zero offset to Parquet #17972

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

nameexhaustion
Copy link
Collaborator

@nameexhaustion nameexhaustion commented Aug 1, 2024

Closes #17905

Scanning the example parquet file from #17905 (comment):

pq_file = "demo.parquet"
lf = pl.scan_parquet(pq_file)
shape = (lf.select(pl.len()).collect().item(), lf.collect_schema().len())
print(shape)
print(lf.tail(1).collect())

Release 1.3.0:

python .env/y.py  9.10s user 4.16s system 500% cpu 2.649 total

This branch (on a debug build):

python .env/y.py  0.66s user 0.04s system 95% cpu 0.728 total

@nameexhaustion nameexhaustion changed the title feat: Push down slice with non-zero offset to Parquet perf: Push down slice with non-zero offset to Parquet Aug 1, 2024
@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars performance Performance issues or improvements labels Aug 1, 2024
Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 97.48603% with 9 lines in your changes missing coverage. Please review.

Project coverage is 80.48%. Comparing base (6065465) to head (5adcf88).
Report is 10 commits behind head on main.

Files Patch % Lines
crates/polars-io/src/parquet/read/read_impl.rs 95.19% 5 Missing ⚠️
...es/polars-mem-engine/src/executors/scan/parquet.rs 98.29% 2 Missing ⚠️
crates/polars-plan/src/plans/ir/format.rs 75.00% 1 Missing ⚠️
py-polars/src/lazyframe/visitor/nodes.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17972      +/-   ##
==========================================
+ Coverage   80.39%   80.48%   +0.08%     
==========================================
  Files        1494     1496       +2     
  Lines      196480   196647     +167     
  Branches     2817     2817              
==========================================
+ Hits       157957   158266     +309     
+ Misses      38003    37860     -143     
- Partials      520      521       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ritchie46 ritchie46 merged commit a3db898 into pola-rs:main Aug 1, 2024
26 checks passed
@coastalwhite
Copy link
Collaborator

I think this should probably also make use of the Filter::Range, but I can do that afterwards.

@wence-
Copy link
Collaborator

wence- commented Aug 2, 2024

@nameexhaustion Sorry, I didn't catch this in the python IR, technically this should have bumped the NodeTraverser major version since the file_options object changed. However, since we already had a bump between 1.3 and 1.4 no harm done. We only recently added this feature so it's not obvious that one had to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature performance Performance issues or improvements python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scan_parquet does not optimise slice or tail operations
4 participants